﻿@model PicStore.Web.Models.Picture.EditPictureModel
@{
    Layout = null;
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/Javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Ajax.BeginForm((string)ViewBag.Action, "Picture", null, new AjaxOptions { HttpMethod = "Post", OnSuccess = (string)ViewBag.OnSuccess }, new { @class = "form-horizontal" }))
{
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>Update Picture</h3>
    </div>
    
    @Html.ValidationSummary(true)
    @Html.HiddenFor(model => model.Id)
    <table>
        <tr>
            <td>
                @Html.LabelFor(model => model.PictureName, new { @class = "control-label" })
            </td>
            <td>@Html.DisplayFor(model => model.PictureName)</td>
        </tr>
        <tr>
            <td>
                @Html.LabelFor(model => model.CreaterName, new { @class = "control-label" })
            </td>
            <td>@Html.DisplayFor(model => model.CreaterName)</td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.TakePhotoDate, new { @class = "control-label" })</td>
            <td>@Html.DisplayFor(model => model.TakePhotoDate)</td>
            <td rowspan="11" style="width: 120px;">
                @{
                    var name = Model.PicturePath;
                    var imagePath = @Url.Content(name);
                }
                <img  style="width: 100px; height: 270px;" id="pictureUrl" src="@imagePath">
            </td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Place, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Place, Model.PlaceList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Sex, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Sex, Model.SexList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Item, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Item, Model.ItemList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Color, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Color, Model.ColorList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Style, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Style, Model.StyleList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Length, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Length, Model.LengthList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Collar, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Collar, Model.CollarList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Front, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Front, Model.FrontList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Sleeve, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Sleeve, Model.SleeveList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.SweaterTexture, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.SweaterTexture, Model.SweaterTextureList)<br/></td>
        </tr>
        <tr>
            <td>@Html.LabelFor(model => model.Type, new { @class = "control-label" })</td>
            <td>@Html.DropDownListFor(m => m.Type, Model.TypeList)<br/></td>
        </tr>
    </table>
    
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Close</a>
        <input type="submit" class="btn btn-primary" value="Save" />
    </div>
}
@*<script type="text/javascript">
    $.validator.unobtrusive.parse(document);
</script>*@